<?php
declare (strict_types=1);

namespace app\api\controller;

use app\api\model\UserReply;


class Reply extends Base
{
    public function index()
    {
        return view();
    }

    public function tb()
    {
        return view();
    }

    public function pddReply()
    {
        return view();
    }

    public function jdReply()
    {
        return view();
    }

    public function mtReply()
    {
        return view();
    }

    public function xtReply()
    {
        return view();
    }

    /**
     *
     *
     * api接口
     *
     */
    public function manage()
    {
        $typeName = $this->request->param('typeName');
        if ($typeName == 'getConfigure') {
            $configreName = $this->request->param('configreName');
            $robotId = $this->request->param('robotId');
            $UserReply = new UserReply;
            return $UserReply->get_datas($robotId, $configreName);

            if ($configreName == 'xiTong') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'daoGou') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'tuiGuang') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'qianDao') {

                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'yuLe') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'cuiDan') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);
            } else if ($configreName == 'fanLi') {
                $UserReply = new UserReply;
                return $UserReply->get_datas($robotId, $configreName);

            } else if ($configreName == 'mianDan') {
                $UserReply = new UserReply;


                return $UserReply->get_datas($robotId, $configreName);
            }

        } else if ($typeName == 'updateConfigure') {
            //post处理

            $configreName = $this->request->param('configreName');
            $robotId = $this->request->param('robotId');
            $data = $this->request->param('data');
            $UserReply = new UserReply;
            return $UserReply->edit_one_data($robotId, $data);

        }
    }

}
